/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-03-16
 * Time: 15:26
 */
public class Date {
    public int year;
    public int month;

    public Date(int year, int month) {
        this.year = year;
        this.month = month;
    }
    // 返回当前对象的引用
    public Date getCurrentObject() {
        return this;
    }
    public void displayInfo() {
        System.out.println(this.year + "/" + this.month);
    }

    public static void main(String[] args) {
        Date date = new Date(1945,8);
        Date somedate = date.getCurrentObject();// 获取当前对象的引用
        date.displayInfo();//输出：1945/8
        somedate.displayInfo();//输出：1945/8
    }
}
